using System;
using System.Windows.Forms;
using System.Drawing;

namespace HIS
{
    public class DiagnosisForm : Form
    {
        private TextBox txtDiagnosisName;
        private ComboBox cmbDiagnosisType;
        private Button btnAddDiagnosis;
        private Button btnLoadPrevious;
        private CheckBox chkDifferential;
        private Button btnReportCard;
        private DataGridView dgvDiagnosisList;

        public DiagnosisForm()
        {
            InitializeComponents();
        }

        private void InitializeComponents()
        {
            // 窗体设置
            this.Text = "录入诊断";
            this.Size = new Size(800, 600);
            this.StartPosition = FormStartPosition.CenterScreen;

            // 诊断名称输入区域
            GroupBox gbDiagnosisInput = new GroupBox
            {
                Text = "诊断信息",
                Location = new Point(20, 20),
                Size = new Size(760, 100)
            };

            // 诊断名称
            Label lblDiagnosisName = new Label
            {
                Text = "诊断名称：",
                Location = new Point(10, 25),
                AutoSize = true
            };

            txtDiagnosisName = new TextBox
            {
                Location = new Point(90, 22),
                Size = new Size(300, 25)
            };

            // 诊断类型
            Label lblDiagnosisType = new Label
            {
                Text = "诊断类型：",
                Location = new Point(400, 25),
                AutoSize = true
            };

            cmbDiagnosisType = new ComboBox
            {
                Location = new Point(480, 22),
                Size = new Size(100, 25),
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            cmbDiagnosisType.Items.AddRange(new string[] { "初诊", "复诊" });

            // 鉴别处理
            chkDifferential = new CheckBox
            {
                Text = "鉴别处理",
                Location = new Point(600, 25),
                AutoSize = true
            };

            gbDiagnosisInput.Controls.AddRange(new Control[] {
                lblDiagnosisName,
                txtDiagnosisName,
                lblDiagnosisType,
                cmbDiagnosisType,
                chkDifferential
            });

            // 按钮区域
            btnAddDiagnosis = new Button
            {
                Text = "添加诊断",
                Location = new Point(20, 140),
                Size = new Size(100, 30)
            };

            btnLoadPrevious = new Button
            {
                Text = "调出上一次诊断",
                Location = new Point(140, 140),
                Size = new Size(120, 30)
            };

            btnReportCard = new Button
            {
                Text = "报卡",
                Location = new Point(280, 140),
                Size = new Size(80, 30)
            };

            // 诊断列表
            dgvDiagnosisList = new DataGridView
            {
                Location = new Point(20, 190),
                Size = new Size(760, 350),
                AllowUserToAddRows = false,
                AllowUserToDeleteRows = false,
                ReadOnly = true,
                SelectionMode = DataGridViewSelectionMode.FullRowSelect
            };

            // 添加列
            dgvDiagnosisList.Columns.AddRange(new DataGridViewColumn[] {
                new DataGridViewTextBoxColumn { Name = "诊断名称", HeaderText = "诊断名称", Width = 200 },
                new DataGridViewTextBoxColumn { Name = "诊断类型", HeaderText = "诊断类型", Width = 100 },
                new DataGridViewCheckBoxColumn { Name = "鉴别处理", HeaderText = "鉴别处理", Width = 80 },
                new DataGridViewTextBoxColumn { Name = "录入时间", HeaderText = "录入时间", Width = 150 }
            });

            // 添加控件到窗体
            this.Controls.AddRange(new Control[] {
                gbDiagnosisInput,
                btnAddDiagnosis,
                btnLoadPrevious,
                btnReportCard,
                dgvDiagnosisList
            });
        }
    }
} 